<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<button type="button" onclick="Get();">获取</button>
		<div id="div"></div>
	</body>
	<script type="text/javascript">
		function Get(){
			var ajax = new XMLHttpRequest();
			ajax.open('GET','http://poetry.apiopen.top/sentences');
			ajax.send();
			ajax.onreadystatechange = function(){
				if(ajax.status==200&&ajax.readyState==4){
					var Obj = JSON.parse(ajax.responseText);
					console.log(Obj);
					var divObj = document.getElementById('div');
					divObj.innerHTML = Obj.result.from+"<br />"+Obj.result.name;
				}
			}
		}
	</script>
</html>
